{#
/**
 * @file
 * alert
 *here we have different types of alert with different colors for every situation.
 * See _alert.wingsuit.yaml for documentation.
 */
#}

{# VARIANTS #}
{% set classes = ([
  "alert",
  variant == 'status' ? "alert-primary",
  variant == 'error' ? "alert-danger",
  variant == 'warning' ? "alert-warning"
] | sort | join(' ') | trim ) %}

{% set attributes = attributes|default(create_attribute()).addClass(classes) %}

{# TEMPLATE #}
<div {{ attributes }}>
  <div class="d-flex">
    {% include "@atoms/svg/svg.twig" with {
      "icon": "alert--" ~ variant,
      "size": "w-6 h-6"
    } only %}
    <div class="ml-2">
      <div class="font-weight-bold">
        {% block header %}{{ header }}{% endblock %}
      </div>
      <div>
        {% block content %}
          {{ content }}
        {% endblock %}
      </div>
    </div>
  </div>
</div>
